package com.responsibility.bll;

/*审批者*/
public abstract class Approval {
    protected String name;
    protected Approval successor;

    public Approval(String name, Approval successor) {
        this.name = name;
        this.successor = successor;
    }

    public void setSuccessor(Approval successor) {
        this.successor = successor;
    }

    public Approval getSuccessor() {
        return successor;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    /*
     * 负责将请求传递给后继者
     * */
    public void handleRequest(Student stu) {
        if (this.successor != null) {
            this.successor.handleRequest(stu);
        }
    }
}
